package logic.operation;

import java.util.LinkedList;
import java.util.List;

import javax.swing.JProgressBar;

import logic.file.IFile;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

/**
 * 
 * @author Marcin
 *
 */
//Dla operacji usuwania pliku obserwacja postępu ma charakter 'pro forma'
public class DeleteOperation extends AbstractObservableFileOperation {
	
	static Logger logger = Logger.getLogger(DeleteOperation.class.getName());

	public DeleteOperation(List<IFile> files, IOperationObserver observer) {
		super(files, observer);
		// TODO Auto-generated constructor stub
	}
	
	public DeleteOperation() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public void execute() {
		logger.info("Deleting:" + files);
		for (IFile file : files) {
			file.delete();
		}
		
	}

	@Override
	public void cancel() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void run() {
		execute();
		
	}

	@Override
	public String getName() {
		return "Deleting";
	}

}
